3.1.38 \(\int (f+g x) (a+b \log (c (d+e x)^n)) \, dx\) [38]

Optimal. Leaf size=91 \[ -\frac {b (e f-d g) n x}{2 e}-\frac {b n (f+g x)^2}{4 g}-\frac {b (e f-d g)^2 n \log (d+e x)}{2 e^2 g}+\frac {(f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 g} \]

[Out]

-1/2*b*(-d*g+e*f)*n*x/e-1/4*b*n*(g*x+f)^2/g-1/2*b*(-d*g+e*f)^2*n*ln(e*x+d)/e^2/g+1/2*(g*x+f)^2*(a+b*ln(c*(e*x+
d)^n))/g

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2442, 45} \begin {gather*} \frac {(f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 g}-\frac {b n (e f-d g)^2 \log (d+e x)}{2 e^2 g}-\frac {b n x (e f-d g)}{2 e}-\frac {b n (f+g x)^2}{4 g} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f + g*x)*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

-1/2*(b*(e*f - d*g)*n*x)/e - (b*n*(f + g*x)^2)/(4*g) - (b*(e*f - d*g)^2*n*Log[d + e*x])/(2*e^2*g) + ((f + g*x)
^2*(a + b*Log[c*(d + e*x)^n]))/(2*g)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rubi steps

\begin {align*} \int (f+g x) \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx &=\frac {(f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 g}-\frac {(b e n) \int \frac {(f+g x)^2}{d+e x} \, dx}{2 g}\\ &=\frac {(f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 g}-\frac {(b e n) \int \left (\frac {g (e f-d g)}{e^2}+\frac {(e f-d g)^2}{e^2 (d+e x)}+\frac {g (f+g x)}{e}\right ) \, dx}{2 g}\\ &=-\frac {b (e f-d g) n x}{2 e}-\frac {b n (f+g x)^2}{4 g}-\frac {b (e f-d g)^2 n \log (d+e x)}{2 e^2 g}+\frac {(f+g x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 g}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 101, normalized size = 1.11 \begin {gather*} a f x-b f n x+\frac {b d g n x}{2 e}+\frac {1}{2} a g x^2-\frac {1}{4} b g n x^2-\frac {b d^2 g n \log (d+e x)}{2 e^2}+\frac {1}{2} b g x^2 \log \left (c (d+e x)^n\right )+\frac {b f (d+e x) \log \left (c (d+e x)^n\right )}{e} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f + g*x)*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

a*f*x - b*f*n*x + (b*d*g*n*x)/(2*e) + (a*g*x^2)/2 - (b*g*n*x^2)/4 - (b*d^2*g*n*Log[d + e*x])/(2*e^2) + (b*g*x^
2*Log[c*(d + e*x)^n])/2 + (b*f*(d + e*x)*Log[c*(d + e*x)^n])/e

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 101, normalized size = 1.11

method result size
norman \(\left (-\frac {1}{4} b g n +\frac {1}{2} a g \right ) x^{2}+b f x \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )+\frac {\left (b d g n -2 b e f n +2 a e f \right ) x}{2 e}+\frac {b g \,x^{2} \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )}{2}-\frac {n \left (b \,d^{2} g -2 b d e f \right ) \ln \left (e x +d \right )}{2 e^{2}}\) \(99\)
default \(x a f +\frac {a g \,x^{2}}{2}+b f \ln \left (c \left (e x +d \right )^{n}\right ) x -b f n x +\frac {b f n d \ln \left (e x +d \right )}{e}+\frac {b g \,x^{2} \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )}{2}-\frac {b g n \,x^{2}}{4}-\frac {n b \,d^{2} g \ln \left (e x +d \right )}{2 e^{2}}+\frac {b d g n x}{2 e}\) \(101\)
risch \(\frac {b x \left (g x +2 f \right ) \ln \left (\left (e x +d \right )^{n}\right )}{2}+\frac {i \pi b g \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}+\frac {i \pi b g \,x^{2} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}-\frac {i \pi b g \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{4}-\frac {i \pi b f x \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {i \pi b f x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i \pi b f x \,\mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {i \pi b f x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {i \pi b g \,x^{2} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{4}+\frac {\ln \left (c \right ) b g \,x^{2}}{2}-\frac {b g n \,x^{2}}{4}-\frac {n b \,d^{2} g \ln \left (e x +d \right )}{2 e^{2}}+\frac {b f n d \ln \left (e x +d \right )}{e}+\ln \left (c \right ) b f x +\frac {a g \,x^{2}}{2}+\frac {b d g n x}{2 e}-b f n x +x a f\) \(338\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x+f)*(a+b*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

x*a*f+1/2*a*g*x^2+b*f*ln(c*(e*x+d)^n)*x-b*f*n*x+b*f/e*n*d*ln(e*x+d)+1/2*b*g*x^2*ln(c*exp(n*ln(e*x+d)))-1/4*b*g
*n*x^2-1/2*n*b*d^2*g/e^2*ln(e*x+d)+1/2*b*d*g*n/e*x

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 104, normalized size = 1.14 \begin {gather*} {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} b f n e - \frac {1}{4} \, {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} b g n e + \frac {1}{2} \, b g x^{2} \log \left ({\left (x e + d\right )}^{n} c\right ) + \frac {1}{2} \, a g x^{2} + b f x \log \left ({\left (x e + d\right )}^{n} c\right ) + a f x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

(d*e^(-2)*log(x*e + d) - x*e^(-1))*b*f*n*e - 1/4*(2*d^2*e^(-3)*log(x*e + d) + (x^2*e - 2*d*x)*e^(-2))*b*g*n*e
+ 1/2*b*g*x^2*log((x*e + d)^n*c) + 1/2*a*g*x^2 + b*f*x*log((x*e + d)^n*c) + a*f*x

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 105, normalized size = 1.15 \begin {gather*} \frac {1}{4} \, {\left (2 \, b d g n x e + 2 \, {\left (b g x^{2} + 2 \, b f x\right )} e^{2} \log \left (c\right ) - {\left ({\left (b g n - 2 \, a g\right )} x^{2} + 4 \, {\left (b f n - a f\right )} x\right )} e^{2} - 2 \, {\left (b d^{2} g n - 2 \, b d f n e - {\left (b g n x^{2} + 2 \, b f n x\right )} e^{2}\right )} \log \left (x e + d\right )\right )} e^{\left (-2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

1/4*(2*b*d*g*n*x*e + 2*(b*g*x^2 + 2*b*f*x)*e^2*log(c) - ((b*g*n - 2*a*g)*x^2 + 4*(b*f*n - a*f)*x)*e^2 - 2*(b*d
^2*g*n - 2*b*d*f*n*e - (b*g*n*x^2 + 2*b*f*n*x)*e^2)*log(x*e + d))*e^(-2)

________________________________________________________________________________________

Sympy [A]
time = 0.40, size = 134, normalized size = 1.47 \begin {gather*} \begin {cases} a f x + \frac {a g x^{2}}{2} - \frac {b d^{2} g \log {\left (c \left (d + e x\right )^{n} \right )}}{2 e^{2}} + \frac {b d f \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {b d g n x}{2 e} - b f n x + b f x \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {b g n x^{2}}{4} + \frac {b g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{2} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (f x + \frac {g x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*f*x + a*g*x**2/2 - b*d**2*g*log(c*(d + e*x)**n)/(2*e**2) + b*d*f*log(c*(d + e*x)**n)/e + b*d*g*n*
x/(2*e) - b*f*n*x + b*f*x*log(c*(d + e*x)**n) - b*g*n*x**2/4 + b*g*x**2*log(c*(d + e*x)**n)/2, Ne(e, 0)), ((a
+ b*log(c*d**n))*(f*x + g*x**2/2), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (85) = 170\).
time = 3.75, size = 186, normalized size = 2.04 \begin {gather*} \frac {1}{2} \, {\left (x e + d\right )}^{2} b g n e^{\left (-2\right )} \log \left (x e + d\right ) - {\left (x e + d\right )} b d g n e^{\left (-2\right )} \log \left (x e + d\right ) - \frac {1}{4} \, {\left (x e + d\right )}^{2} b g n e^{\left (-2\right )} + {\left (x e + d\right )} b d g n e^{\left (-2\right )} + {\left (x e + d\right )} b f n e^{\left (-1\right )} \log \left (x e + d\right ) + \frac {1}{2} \, {\left (x e + d\right )}^{2} b g e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b d g e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b f n e^{\left (-1\right )} + \frac {1}{2} \, {\left (x e + d\right )}^{2} a g e^{\left (-2\right )} - {\left (x e + d\right )} a d g e^{\left (-2\right )} + {\left (x e + d\right )} b f e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )} a f e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/2*(x*e + d)^2*b*g*n*e^(-2)*log(x*e + d) - (x*e + d)*b*d*g*n*e^(-2)*log(x*e + d) - 1/4*(x*e + d)^2*b*g*n*e^(-
2) + (x*e + d)*b*d*g*n*e^(-2) + (x*e + d)*b*f*n*e^(-1)*log(x*e + d) + 1/2*(x*e + d)^2*b*g*e^(-2)*log(c) - (x*e
 + d)*b*d*g*e^(-2)*log(c) - (x*e + d)*b*f*n*e^(-1) + 1/2*(x*e + d)^2*a*g*e^(-2) - (x*e + d)*a*d*g*e^(-2) + (x*
e + d)*b*f*e^(-1)*log(c) + (x*e + d)*a*f*e^(-1)

________________________________________________________________________________________

Mupad [B]
time = 0.25, size = 104, normalized size = 1.14 \begin {gather*} x\,\left (\frac {2\,a\,d\,g+2\,a\,e\,f-2\,b\,e\,f\,n}{2\,e}-\frac {d\,g\,\left (2\,a-b\,n\right )}{2\,e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,g\,x^2}{2}+b\,f\,x\right )-\frac {\ln \left (d+e\,x\right )\,\left (b\,d^2\,g\,n-2\,b\,d\,e\,f\,n\right )}{2\,e^2}+\frac {g\,x^2\,\left (2\,a-b\,n\right )}{4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f + g*x)*(a + b*log(c*(d + e*x)^n)),x)

[Out]

x*((2*a*d*g + 2*a*e*f - 2*b*e*f*n)/(2*e) - (d*g*(2*a - b*n))/(2*e)) + log(c*(d + e*x)^n)*(b*f*x + (b*g*x^2)/2)
 - (log(d + e*x)*(b*d^2*g*n - 2*b*d*e*f*n))/(2*e^2) + (g*x^2*(2*a - b*n))/4

________________________________________________________________________________________